#ifndef CGRAPHICSMANAGER_H
#define CGRAPHICSMANAGER_H

#include <string>

#include <GL/glfw.h>

#define VIDMODE_ALPHA_BIT_NUM                                       8
#define VIDMODE_DEPTH_BIT_NUM                                       0
#define VIDMODE_STENCIL_BIT_NUM                                     0
#define VIDMODE_LIST_COUNT                                          100
#define VSYNC_DEFAULT_VALUE                                         1

void GLFWCALL ResizeWindowCallback(int width, int height);


class CGraphicsManager
{
private:
    bool m_FullScreen;
    std::string m_WindowTitle;
    int m_WindowWidth;
    int m_WindowHeight;
    int m_RedBits;
    int m_GreenBits;
    int m_BlueBits;
    int m_AlphaBits;
    int m_DepthBits;
    int m_StencilBits;
    int m_VSync;

    static std::string m_ErrorString;

    CGraphicsManager(const CGraphicsManager& other);
    CGraphicsManager& operator=(const CGraphicsManager& other);

protected:
public:
    CGraphicsManager();
    virtual ~CGraphicsManager();

    bool Init(const std::string& windowTitle);
    void LoadConfigurationValues();
    void SaveConfigurationValues();
    bool OpenWindow(const std::string& windowTitle);

    static GLuint LoadShader(const std::string& fileName, GLenum type);

    // Getter Functions

    static std::string GetErrorString()                             { return m_ErrorString; }
};

#endif // CGRAPHICSMANAGER_H
